<?php
    //ini_set('display_errors',1);
    include ("lib_db.php");
	include("function.php");
	include("config.php");
	if(!isset($_SESSION)){ session_start();}
if(!isset($_SESSION['user'])){
header('location:login.php');
exit();
}else{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xlmns="http://www.w3.org/1999/xhtml">
<head><?php include("view/head.php");?></head>

<body>
<div class="wrapper">
	<div class="header"><?php include ("view/header.php");?></div>
	<div class="clear"></div>
	<div class="content">
		<div class="menu"><?php include("view/menu.php");?></div>
		<div class="center_content">
			<div class="left_content"> <?php include ("view/left_content.php");?></div>
 <?php 
 if(isset($_POST['insert'])){
    if(isset($_REQUEST['nsp'])){
        $name=$_REQUEST['nsp'];
        $sql="insert into category (NameCategory) values ('{$name}')";
        $query=exec_update($sql);
    }
 }
 ?>
			<div class="right_content">
				<h2>Thêm nhóm sản phẩm</h2>
                <form action="edit_gid.php" method="POST">              
    				<table>
                        <tr class="title">
                            <td><span>Tên nhóm sản phẩm:</span></td>
                            <td><input type="text" value="" style="width:240px" name="nsp"></td>
                        </tr>
                        <tr class="value">
                            <td></td>
                            <td>
                                <input type="reset" value="Nhập lại" name="reset"/>
                                <input type="submit" value="Thêm" name="insert"/>
                            </td>
                        </tr>
                    </table>
                </form>
		  </div>
          <div class="right_content">
				<h2>Nhóm sản phẩm</h2>
				<?php echo group_pd();?>
				<a class="bt_green" href="#"><span class="bt_green_lft"></span><strong>Add new item</strong><span class="bt_green_r"></span></a>
				<a class="bt_blue" href="#"><span class="bt_blue_lft"></span><strong>View all items from category</strong><span class="bt_blue_r"></span></a>
				<a class="bt_red" href="#"><span class="bt_red_lft"></span><strong>Delete items</strong><span class="bt_red_r"></span></a>
				
				<
		  </div>
	</div>
	<div class="clear"></div>
	<div class="footer">
		<div class="left_ft">
			<span>IN ADMIN PANEL | Powered by</span>
			<a href="http://indeziner.com">INDEZINER</a>
		</div>
		<div class="right_ft">
			<a href="http://indeziner.com"><img border="0" title="" alt="" src="images/indeziner_logo.gif"></a>
		</div>
	</div>
</div>
</body>
</html>
<?php } ?>